<template>
	<view>
		<image class="backtop" :src="backtop" :hidden='floorstatus' @tap="goTop"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				floorstatus: true,
				backtop: 'https://www.frisobaby.com/resources/images/mobile/index/backon.png'
			};
		},
		methods: {
			goTop: function(e) {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				});
			},
		},
		onPageScroll: function(e) {
			if (e.scrollTop > 100) {
				this.floorstatus = false
			} else {
				this.floorstatus = true
			};
		},
	}
</script>

<style>
	.backtop {
		width: 82upx;
		height: 82upx;
		position: fixed;
		bottom: 108upx;
		right: 20upx;
		z-index: 9999;
		border-radius: 50%;
	}
</style>
